package javabasic.threads.CreateThreadMethods;

public class RunnableMethod {
    public static void main(String[] args) {
        Thread myThread = new Thread(new MyThread2());
        myThread.start();
        for (int i = 0; i < 2000; i++) {
            System.out.println("主线程执行："+i);
        }
    }
}

class MyThread2 implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 2000; i++) {
            System.out.println("子线程执行："+i);
        }
    }
}
